/*   1:    */ package org.jetbrains.jps.model.serialization.java;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.text.StringUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsElementFactory;
import org.jetbrains.jps.model.JpsProject;
import org.jetbrains.jps.model.JpsUrlList;
import org.jetbrains.jps.model.java.*;
import org.jetbrains.jps.model.library.JpsOrderRootType;
import org.jetbrains.jps.model.module.JpsDependencyElement;
import org.jetbrains.jps.model.module.JpsModule;
import org.jetbrains.jps.model.module.JpsModuleReference;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
import org.jetbrains.jps.model.serialization.JpsModelSerializerExtension;
import org.jetbrains.jps.model.serialization.JpsProjectExtensionSerializer;
import org.jetbrains.jps.model.serialization.artifact.JpsPackagingElementSerializer;
import org.jetbrains.jps.model.serialization.java.compiler.*;
import org.jetbrains.jps.model.serialization.library.JpsLibraryRootTypeSerializer;
import org.jetbrains.jps.model.serialization.module.JpsModuleSourceRootDummyPropertiesSerializer;
import org.jetbrains.jps.model.serialization.module.JpsModuleSourceRootPropertiesSerializer;

import java.util.Arrays;
import java.util.List;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */
/*  22:    */
/*  23:    */
/*  24:    */
/*  25:    */
/*  26:    */
/*  27:    */
/*  28:    */
/*  29:    */
/*  30:    */
/*  31:    */
/*  32:    */
/*  33:    */
/*  34:    */
/*  35:    */
/*  36:    */
/*  37:    */
/*  38:    */
/*  39:    */
/*  40:    */
/*  41:    */ 
/*  42:    */ public class JpsJavaModelSerializerExtension
/*  43:    */   extends JpsModelSerializerExtension
/*  44:    */ {
/*  45:    */   public static final String EXPORTED_ATTRIBUTE = "exported";
/*  46:    */   public static final String SCOPE_ATTRIBUTE = "scope";
/*  47:    */   public static final String OUTPUT_TAG = "output";
/*  48:    */   public static final String URL_ATTRIBUTE = "url";
/*  49:    */   public static final String LANGUAGE_LEVEL_ATTRIBUTE = "languageLevel";
/*  50:    */   public static final String EXPLODED_TAG = "exploded";
/*  51:    */   public static final String EXCLUDE_EXPLODED_TAG = "exclude-exploded";
/*  52:    */   public static final String TEST_OUTPUT_TAG = "output-test";
/*  53:    */   public static final String INHERIT_COMPILER_OUTPUT_ATTRIBUTE = "inherit-compiler-output";
/*  54:    */   public static final String EXCLUDE_OUTPUT_TAG = "exclude-output";
/*  55:    */   private static final String a = "annotation-paths";
/*  56:    */   private static final String b = "javadoc-paths";
/*  57:    */   private static final String c = "LANGUAGE_LEVEL";
/*  58:    */   public static final String ROOT_TAG = "root";
/*  59:    */   private static final String d = "generated";
/*  60: 60 */   public static final JavaSourceRootPropertiesSerializer JAVA_SOURCE_ROOT_PROPERTIES_SERIALIZER = new JavaSourceRootPropertiesSerializer(JavaSourceRootType.SOURCE, "java-source", null);
/*  61:    */   
/*  62:    */   public void loadRootModel(@NotNull JpsModule paramJpsModule, @NotNull Element paramElement)
/*  63:    */   {
/*  64: 65 */     if (paramJpsModule == null) {
/*  65: 65 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "loadRootModel" }));
/*  66:    */     }
/*  67: 65 */     if (paramElement == null) {
/*  68: 65 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "loadRootModel" }));
/*  69:    */     }
/*  70: 65 */     a(paramJpsModule, paramElement);
/*  71: 66 */     c(paramJpsModule, paramElement);
/*  72:    */   }
/*  73:    */   
/*  74:    */   public void saveRootModel(@NotNull JpsModule paramJpsModule, @NotNull Element paramElement)
/*  75:    */   {
/*  76: 71 */     if (paramJpsModule == null) {
/*  77: 71 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "saveRootModel" }));
/*  78:    */     }
/*  79: 71 */     if (paramElement == null) {
/*  80: 71 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "saveRootModel" }));
/*  81:    */     }
/*  82: 71 */     b(paramJpsModule, paramElement);
/*  83: 72 */     d(paramJpsModule, paramElement);
/*  84:    */   }
/*  85:    */   
/*  86:    */   @NotNull
/*  87:    */   public List<? extends JpsProjectExtensionSerializer> getProjectExtensionSerializers()
/*  88:    */   {
/*  89: 78 */     List tmp80_77 = Arrays.asList(new JpsProjectExtensionSerializer[] { new JavaProjectExtensionSerializer(), new JpsJavaCompilerConfigurationSerializer(), new JpsJavaCompilerWorkspaceConfigurationSerializer(), new JpsJavaCompilerOptionsSerializer("JavacSettings", "Javac"), new JpsEclipseCompilerOptionsSerializer("EclipseCompilerSettings", "Eclipse"), new RmicCompilerOptionsSerializer("RmicSettings", "Rmic") });
/*  90: 78 */     if (tmp80_77 == null) {
/*  91: 78 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "getProjectExtensionSerializers" }));
/*  92:    */     }
/*  93: 78 */     return tmp80_77;
/*  94:    */   }
/*  95:    */   
/*  96:    */   @NotNull
/*  97:    */   public List<? extends JpsModuleSourceRootPropertiesSerializer<?>> getModuleSourceRootPropertiesSerializers()
/*  98:    */   {
/*  99: 89 */     List tmp59_56 = Arrays.asList(new JpsModuleSourceRootPropertiesSerializer[] { JAVA_SOURCE_ROOT_PROPERTIES_SERIALIZER, new JavaSourceRootPropertiesSerializer(JavaSourceRootType.TEST_SOURCE, "java-test", null), new JpsModuleSourceRootDummyPropertiesSerializer(JavaResourceRootType.RESOURCE, "java-resource"), new JpsModuleSourceRootDummyPropertiesSerializer(JavaResourceRootType.TEST_RESOURCE, "java-test-resource") });
/* 100: 89 */     if (tmp59_56 == null) {
/* 101: 89 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "getModuleSourceRootPropertiesSerializers" }));
/* 102:    */     }
/* 103: 89 */     return tmp59_56;
/* 104:    */   }
/* 105:    */   
/* 106:    */   public void loadModuleDependencyProperties(JpsDependencyElement paramJpsDependencyElement, Element paramElement)
/* 107:    */   {
/* 108: 97 */     boolean bool = paramElement.getAttributeValue("exported") != null;
/* 109: 98 */     String str = paramElement.getAttributeValue("scope");
/* 110: 99 */     JpsJavaDependencyScope localJpsJavaDependencyScope = null;
/* 111:    */     try
/* 112:    */     {
/* 113:101 */       localJpsJavaDependencyScope = str != null ? JpsJavaDependencyScope.valueOf(str) : JpsJavaDependencyScope.COMPILE;
/* 114:    */     }
/* 115:    */     catch (IllegalArgumentException localIllegalArgumentException)
/* 116:    */     {
/* 117:104 */       localJpsJavaDependencyScope = JpsJavaDependencyScope.COMPILE;
/* 118:    */     }
/* 119:107 */     JpsJavaDependencyExtension localJpsJavaDependencyExtension = a().getOrCreateDependencyExtension(paramJpsDependencyElement);
/* 120:108 */     localJpsJavaDependencyExtension.setExported(bool);
/* 121:109 */     localJpsJavaDependencyExtension.setScope(localJpsJavaDependencyScope);
/* 122:    */   }
/* 123:    */   
/* 124:    */   public void saveModuleDependencyProperties(JpsDependencyElement paramJpsDependencyElement, Element paramElement)
/* 125:    */   {
/* 126:114 */     JpsJavaDependencyExtension localJpsJavaDependencyExtension = a().getDependencyExtension(paramJpsDependencyElement);
/* 127:115 */     if (localJpsJavaDependencyExtension != null)
/* 128:    */     {
/* 129:116 */       if (localJpsJavaDependencyExtension.isExported()) {
/* 130:117 */         paramElement.setAttribute("exported", "");
/* 131:    */       }
/* 132:119 */       JpsJavaDependencyScope localJpsJavaDependencyScope = localJpsJavaDependencyExtension.getScope();
/* 133:120 */       if (localJpsJavaDependencyScope != JpsJavaDependencyScope.COMPILE) {
/* 134:121 */         paramElement.setAttribute("scope", localJpsJavaDependencyScope.name());
/* 135:    */       }
/* 136:    */     }
/* 137:    */   }
/* 138:    */   
/* 139:    */   public List<JpsLibraryRootTypeSerializer> getLibraryRootTypeSerializers()
/* 140:    */   {
/* 141:128 */     return Arrays.asList(new JpsLibraryRootTypeSerializer[] { new JpsLibraryRootTypeSerializer("JAVADOC", JpsOrderRootType.DOCUMENTATION, true), new JpsLibraryRootTypeSerializer("ANNOTATIONS", JpsAnnotationRootType.INSTANCE, false) });
/* 142:    */   }
/* 143:    */   
/* 144:    */   @NotNull
/* 145:    */   public List<JpsLibraryRootTypeSerializer> getSdkRootTypeSerializers()
/* 146:    */   {
/* 147:135 */     List tmp41_38 = Arrays.asList(new JpsLibraryRootTypeSerializer[] { new JpsLibraryRootTypeSerializer("javadocPath", JpsOrderRootType.DOCUMENTATION, true), new JpsLibraryRootTypeSerializer("annotationsPath", JpsAnnotationRootType.INSTANCE, true) });
/* 148:135 */     if (tmp41_38 == null) {
/* 149:135 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "getSdkRootTypeSerializers" }));
/* 150:    */     }
/* 151:135 */     return tmp41_38;
/* 152:    */   }
/* 153:    */   
/* 154:    */   @NotNull
/* 155:    */   public List<? extends JpsPackagingElementSerializer<?>> getPackagingElementSerializers()
/* 156:    */   {
/* 157:142 */     List tmp29_26 = Arrays.asList(new JpsPackagingElementSerializer[] { new JpsModuleOutputPackagingElementSerializer(null), new JpsTestModuleOutputPackagingElementSerializer(null) });
/* 158:142 */     if (tmp29_26 == null) {
/* 159:142 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension", "getPackagingElementSerializers" }));
/* 160:    */     }
/* 161:142 */     return tmp29_26;
/* 162:    */   }
/* 163:    */   
/* 164:    */   private static void a(JpsModule paramJpsModule, Element paramElement)
/* 165:    */   {
/* 166:146 */     Element localElement = paramElement.getChild("exploded");
/* 167:147 */     if (localElement != null)
/* 168:    */     {
/* 169:148 */       ExplodedDirectoryModuleExtension localExplodedDirectoryModuleExtension = a().getOrCreateExplodedDirectoryExtension(paramJpsModule);
/* 170:149 */       localExplodedDirectoryModuleExtension.setExcludeExploded(paramElement.getChild("exclude-exploded") != null);
/* 171:150 */       localExplodedDirectoryModuleExtension.setExplodedUrl(localElement.getAttributeValue("url"));
/* 172:    */     }
/* 173:    */   }
/* 174:    */   
/* 175:    */   private static void b(JpsModule paramJpsModule, Element paramElement)
/* 176:    */   {
/* 177:155 */     ExplodedDirectoryModuleExtension localExplodedDirectoryModuleExtension = a().getExplodedDirectoryExtension(paramJpsModule);
/* 178:156 */     if (localExplodedDirectoryModuleExtension != null)
/* 179:    */     {
/* 180:157 */       if (localExplodedDirectoryModuleExtension.isExcludeExploded()) {
/* 181:158 */         paramElement.addContent(0, new Element("exclude-exploded"));
/* 182:    */       }
/* 183:160 */       paramElement.addContent(0, new Element("exploded").setAttribute("url", localExplodedDirectoryModuleExtension.getExplodedUrl()));
/* 184:    */     }
/* 185:    */   }
/* 186:    */   
/* 187:    */   private static void c(JpsModule paramJpsModule, Element paramElement)
/* 188:    */   {
/* 189:165 */     JpsJavaModuleExtension localJpsJavaModuleExtension = a().getOrCreateModuleExtension(paramJpsModule);
/* 190:166 */     Element localElement1 = paramElement.getChild("output");
/* 191:167 */     String str1 = localElement1 != null ? localElement1.getAttributeValue("url") : null;
/* 192:168 */     localJpsJavaModuleExtension.setOutputUrl(str1);
/* 193:169 */     Element localElement2 = paramElement.getChild("output-test");
/* 194:170 */     String str2 = localElement2 != null ? localElement2.getAttributeValue("url") : null;
/* 195:171 */     localJpsJavaModuleExtension.setTestOutputUrl(StringUtil.isEmpty(str2) ? str1 : str2);
/* 196:    */     
/* 197:173 */     localJpsJavaModuleExtension.setInheritOutput(Boolean.parseBoolean(paramElement.getAttributeValue("inherit-compiler-output")));
/* 198:174 */     localJpsJavaModuleExtension.setExcludeOutput(paramElement.getChild("exclude-output") != null);
/* 199:    */     
/* 200:176 */     String str3 = paramElement.getAttributeValue("LANGUAGE_LEVEL");
/* 201:177 */     if (str3 != null) {
/* 202:178 */       localJpsJavaModuleExtension.setLanguageLevel(LanguageLevel.valueOf(str3));
/* 203:    */     }
/* 204:181 */     a(paramElement, "annotation-paths", localJpsJavaModuleExtension.getAnnotationRoots());
/* 205:182 */     a(paramElement, "javadoc-paths", localJpsJavaModuleExtension.getJavadocRoots());
/* 206:    */   }
/* 207:    */   
/* 208:    */   private static void d(JpsModule paramJpsModule, Element paramElement)
/* 209:    */   {
/* 210:186 */     JpsJavaModuleExtension localJpsJavaModuleExtension = a().getModuleExtension(paramJpsModule);
/* 211:187 */     if (localJpsJavaModuleExtension == null) {
/* 212:187 */       return;
/* 213:    */     }
/* 214:188 */     if (localJpsJavaModuleExtension.isExcludeOutput()) {
/* 215:189 */       paramElement.addContent(0, new Element("exclude-output"));
/* 216:    */     }
/* 217:192 */     String str1 = localJpsJavaModuleExtension.getTestOutputUrl();
/* 218:193 */     if (str1 != null) {
/* 219:194 */       paramElement.addContent(0, new Element("output-test").setAttribute("url", str1));
/* 220:    */     }
/* 221:197 */     String str2 = localJpsJavaModuleExtension.getOutputUrl();
/* 222:198 */     if (str2 != null) {
/* 223:199 */       paramElement.addContent(0, new Element("output").setAttribute("url", str2));
/* 224:    */     }
/* 225:202 */     LanguageLevel localLanguageLevel = localJpsJavaModuleExtension.getLanguageLevel();
/* 226:203 */     if (localLanguageLevel != null) {
/* 227:204 */       paramElement.setAttribute("LANGUAGE_LEVEL", localLanguageLevel.name());
/* 228:    */     }
/* 229:206 */     paramElement.setAttribute("inherit-compiler-output", String.valueOf(localJpsJavaModuleExtension.isInheritOutput()));
/* 230:207 */     b(paramElement, "javadoc-paths", localJpsJavaModuleExtension.getJavadocRoots());
/* 231:208 */     b(paramElement, "annotation-paths", localJpsJavaModuleExtension.getAnnotationRoots());
/* 232:    */   }
/* 233:    */   
/* 234:    */   private static void a(Element paramElement, String paramString, JpsUrlList paramJpsUrlList)
/* 235:    */   {
/* 236:212 */     Element localElement1 = paramElement.getChild(paramString);
/* 237:213 */     for (Element localElement2 : JDOMUtil.getChildren(localElement1, "root")) {
/* 238:214 */       paramJpsUrlList.addUrl(localElement2.getAttributeValue("url"));
/* 239:    */     }
/* 240:    */   }
/* 241:    */   
/* 242:    */   private static void b(Element paramElement, String paramString, JpsUrlList paramJpsUrlList)
/* 243:    */   {
/* 244:219 */     List localList = paramJpsUrlList.getUrls();
/* 245:220 */     if (!localList.isEmpty())
/* 246:    */     {
/* 247:221 */       Element localElement = new Element(paramString);
/* 248:222 */       for (String str : localList) {
/* 249:223 */         localElement.addContent(new Element("root").setAttribute("url", str));
/* 250:    */       }
/* 251:225 */       paramElement.addContent(localElement);
/* 252:    */     }
/* 253:    */   }
/* 254:    */   
/* 255:    */   private static JpsJavaExtensionService a()
/* 256:    */   {
/* 257:230 */     return JpsJavaExtensionService.getInstance();
/* 258:    */   }
/* 259:    */   
/* 260:    */   private static class JpsModuleOutputPackagingElementSerializer
/* 261:    */     extends JpsPackagingElementSerializer<JpsProductionModuleOutputPackagingElement>
/* 262:    */   {
/* 263:    */     private JpsModuleOutputPackagingElementSerializer()
/* 264:    */     {
/* 265:236 */       super(JpsProductionModuleOutputPackagingElement.class);
/* 266:    */     }
/* 267:    */     
/* 268:    */     public JpsProductionModuleOutputPackagingElement load(Element paramElement)
/* 269:    */     {
/* 270:241 */       JpsModuleReference localJpsModuleReference = JpsElementFactory.getInstance().createModuleReference(paramElement.getAttributeValue("name"));
/* 271:242 */       return JpsJavaModelSerializerExtension.access$300().createProductionModuleOutput(localJpsModuleReference);
/* 272:    */     }
/* 273:    */     
/* 274:    */     public void save(JpsProductionModuleOutputPackagingElement paramJpsProductionModuleOutputPackagingElement, Element paramElement)
/* 275:    */     {
/* 276:247 */       paramElement.setAttribute("name", paramJpsProductionModuleOutputPackagingElement.getModuleReference().getModuleName());
/* 277:    */     }
/* 278:    */   }
/* 279:    */   
/* 280:    */   private static class JpsTestModuleOutputPackagingElementSerializer
/* 281:    */     extends JpsPackagingElementSerializer<JpsTestModuleOutputPackagingElement>
/* 282:    */   {
/* 283:    */     private JpsTestModuleOutputPackagingElementSerializer()
/* 284:    */     {
/* 285:253 */       super(JpsTestModuleOutputPackagingElement.class);
/* 286:    */     }
/* 287:    */     
/* 288:    */     public JpsTestModuleOutputPackagingElement load(Element paramElement)
/* 289:    */     {
/* 290:258 */       JpsModuleReference localJpsModuleReference = JpsElementFactory.getInstance().createModuleReference(paramElement.getAttributeValue("name"));
/* 291:259 */       return JpsJavaModelSerializerExtension.access$300().createTestModuleOutput(localJpsModuleReference);
/* 292:    */     }
/* 293:    */     
/* 294:    */     public void save(JpsTestModuleOutputPackagingElement paramJpsTestModuleOutputPackagingElement, Element paramElement)
/* 295:    */     {
/* 296:264 */       paramElement.setAttribute("name", paramJpsTestModuleOutputPackagingElement.getModuleReference().getModuleName());
/* 297:    */     }
/* 298:    */   }
/* 299:    */   
/* 300:    */   private static class JavaProjectExtensionSerializer
/* 301:    */     extends JpsProjectExtensionSerializer
/* 302:    */   {
/* 303:    */     public JavaProjectExtensionSerializer()
/* 304:    */     {
/* 305:270 */       super("ProjectRootManager");
/* 306:    */     }
/* 307:    */     
/* 308:    */     public void loadExtension(@NotNull JpsProject paramJpsProject, @NotNull Element paramElement)
/* 309:    */     {
/* 310:275 */       if (paramJpsProject == null) {
/* 311:275 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer", "loadExtension" }));
/* 312:    */       }
/* 313:275 */       if (paramElement == null) {
/* 314:275 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer", "loadExtension" }));
/* 315:    */       }
/* 316:275 */       JpsJavaProjectExtension localJpsJavaProjectExtension = JpsJavaModelSerializerExtension.access$300().getOrCreateProjectExtension(paramJpsProject);
/* 317:276 */       Element localElement = paramElement.getChild("output");
/* 318:277 */       if (localElement != null)
/* 319:    */       {
/* 320:278 */         str = localElement.getAttributeValue("url");
/* 321:279 */         if (str != null) {
/* 322:280 */           localJpsJavaProjectExtension.setOutputUrl(str);
/* 323:    */         }
/* 324:    */       }
/* 325:283 */       String str = paramElement.getAttributeValue("languageLevel");
/* 326:284 */       if (str != null) {
/* 327:285 */         localJpsJavaProjectExtension.setLanguageLevel(LanguageLevel.valueOf(str));
/* 328:    */       }
/* 329:    */     }
/* 330:    */     
/* 331:    */     public void saveExtension(@NotNull JpsProject paramJpsProject, @NotNull Element paramElement)
/* 332:    */     {
/* 333:291 */       if (paramJpsProject == null) {
/* 334:291 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer", "saveExtension" }));
/* 335:    */       }
/* 336:291 */       if (paramElement == null) {
/* 337:291 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer", "saveExtension" }));
/* 338:    */       }
/* 339:291 */       JpsJavaProjectExtension localJpsJavaProjectExtension = JpsJavaModelSerializerExtension.access$300().getProjectExtension(paramJpsProject);
/* 340:292 */       if (localJpsJavaProjectExtension == null) {
/* 341:292 */         return;
/* 342:    */       }
/* 343:294 */       String str = localJpsJavaProjectExtension.getOutputUrl();
/* 344:295 */       if (str != null) {
/* 345:296 */         paramElement.addContent(new Element("output").setAttribute("url", str));
/* 346:    */       }
/* 347:298 */       LanguageLevel localLanguageLevel = localJpsJavaProjectExtension.getLanguageLevel();
/* 348:299 */       paramElement.setAttribute("languageLevel", localLanguageLevel.name());
/* 349:300 */       paramElement.setAttribute("assert-keyword", Boolean.toString(localLanguageLevel.compareTo(LanguageLevel.JDK_1_4) >= 0));
/* 350:301 */       paramElement.setAttribute("jdk-15", Boolean.toString(localLanguageLevel.compareTo(LanguageLevel.JDK_1_5) >= 0));
/* 351:    */     }
/* 352:    */   }
/* 353:    */   
/* 354:    */   private static class JavaSourceRootPropertiesSerializer
/* 355:    */     extends JpsModuleSourceRootPropertiesSerializer<JavaSourceRootProperties>
/* 356:    */   {
/* 357:    */     JavaSourceRootPropertiesSerializer(JpsModuleSourceRootType paramJpsModuleSourceRootType, String paramString, JpsJavaModelSerializerExtension.0 param0)
/* 358:    */     {
/* 359:305 */       this(paramJpsModuleSourceRootType, paramString);
/* 360:    */     }
/* 361:    */     
/* 362:    */     private JavaSourceRootPropertiesSerializer(JpsModuleSourceRootType<JavaSourceRootProperties> paramJpsModuleSourceRootType, String paramString)
/* 363:    */     {
/* 364:307 */       super(paramString);
/* 365:    */     }
/* 366:    */     
/* 367:    */     public JavaSourceRootProperties loadProperties(@NotNull Element paramElement)
/* 368:    */     {
/* 369:312 */       if (paramElement == null) {
/* 370:312 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaSourceRootPropertiesSerializer", "loadProperties" }));
/* 371:    */       }
/* 372:312 */       String str = StringUtil.notNullize(paramElement.getAttributeValue("packagePrefix"));
/* 373:313 */       boolean bool = Boolean.parseBoolean(paramElement.getAttributeValue("generated"));
/* 374:314 */       return JpsJavaModelSerializerExtension.access$300().createSourceRootProperties(str, bool);
/* 375:    */     }
/* 376:    */     
/* 377:    */     public void saveProperties(@NotNull JavaSourceRootProperties paramJavaSourceRootProperties, @NotNull Element paramElement)
/* 378:    */     {
/* 379:319 */       if (paramJavaSourceRootProperties == null) {
/* 380:319 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaSourceRootPropertiesSerializer", "saveProperties" }));
/* 381:    */       }
/* 382:319 */       if (paramElement == null) {
/* 383:319 */         throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaSourceRootPropertiesSerializer", "saveProperties" }));
/* 384:    */       }
/* 385:319 */       String str1 = Boolean.toString(((JpsModuleSourceRootType)getType()).equals(JavaSourceRootType.TEST_SOURCE));
/* 386:320 */       paramElement.setAttribute("isTestSource", str1);
/* 387:321 */       String str2 = paramJavaSourceRootProperties.getPackagePrefix();
/* 388:322 */       if (!str2.isEmpty()) {
/* 389:323 */         paramElement.setAttribute("packagePrefix", str2);
/* 390:    */       }
/* 391:325 */       if (paramJavaSourceRootProperties.isForGeneratedSources()) {
/* 392:326 */         paramElement.setAttribute("generated", Boolean.TRUE.toString());
/* 393:    */       }
/* 394:    */     }
/* 395:    */   }
/* 396:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.serialization.java.JpsJavaModelSerializerExtension

 * JD-Core Version:    0.7.0.1

 */